var events = require("events");

var Emitter = events.EventEmitter;
//构造函数
function Dog(dogName){
    Emitter.call(this);//实现对EventEmitter的继承
    this.dogName = dogName;
}
//继承EventEmitter的方法和属性
Dog.prototype = Emitter.prototype;
Dog.prototype.bark = function(){
    console.log(this.dogName + "barked");
}
//对外公布Dog构造函数
module.exports = Dog;